export async function post (url, body) {
  return (await fetch(url, {
    mode: 'cors',
    headers: {
      'Content-Type': 'application/json'
    },
    method: 'POST',
    body: JSON.stringify(body)
  })).json()
}

export async function put (url, body) {
  return (await fetch(url, {
    mode: 'cors',
    headers: {
      'Content-Type': 'application/json'
    },
    method: 'PUT',
    body: JSON.stringify(body)
  })).json()
}

export async function get (url) {
  return (await fetch(url, {
    mode: 'cors',
    method: 'GET'
  })).json()
}

export async function Delete (url, body) {
  return (await fetch(url, {
    mode: 'cors',
    headers: {
      'Content-Type': 'application/json'
    },
    method: 'DELETE',
    body: JSON.stringify(body)
  })).json()
}